package com.sd.mapper;
import com.sd.common.beans.AppInfo;
import com.sd.domain.Assistant;
import org.apache.ibatis.annotations.*;
/**
 * @author yexinming
 * @date 2020/3/12
 **/
@Mapper
public interface AppInfoMapper {
    /**
     * 保存
     * @param appInfo 应用信息
     */
    @Insert("insert into app_info(" +
                "app_id," +
                "app_secret," +
                "gmt_create," +
                "gmt_modified" +
            ") values(" +
                "#{appId}," +
                "#{appSecret}," +
                "#{gmtCreate}," +
                "#{gmtModified}" +
            ")")
    void save(AppInfo appInfo);
    /**
     * 查询校董助理
     * @param appId
     * @return
     */
    @Select("select " +
                "app_id," +
                "app_secret," +
                "gmt_create," +
                "gmt_modified " +
            "from app_info " +
            "where app_id = #{appId}")
    @Results({
            @Result(column = "app_id", property = "appId"),
            @Result(column = "app_secret", property = "appSecret"),
            @Result(column = "gmt_create", property = "gmtCreate"),
            @Result(column = "gmt_modified", property = "gmtModified")
       }
    )
    AppInfo getByAppId(@Param("appId") String appId);
}
